@import '@/styles/utils.scss';

.container {
  flex: 1;
  width: 100%;
  position: relative;
  font-size: 16px;

  .compCont {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: calc(100% + 6px);
    overflow: auto;
    padding-right: 6px;
    // padding: 20px 40px;
  }

  table {
    width: 100%;
    font-size: 9px;
    border-collapse: collapse;
    margin: 8px 0;
  }
  
  th, td {
    border: 1px solid var(--theme-border);
    padding: 4px 6px;
    text-align: left;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  
  th {
    background-color: var(--theme-surface-variant);
  }

  :global {
    #chat-container {
      margin: 0 auto;
      display: flex;
      flex-direction: column;
      // gap: 24px;
    }
  
    .msgByUse {
      align-self: flex-end;
      margin: 8px 0;
    }
  
    .welcome-message {
      text-align: center;
      padding: 40px 0;
      color: #71717A;
    }
  
    .text-muted-foreground {
      color: #71717A;
    }
  
    .dark {
      .text-muted-foreground {
        color: #A1A1AA;
      }
    }
  }
}


.msgItemUser{
  box-sizing: border-box;
  font-size: 16px;
  color: #000;
  max-width:647px !important;
  border-radius: 8px;
  padding: 12px 16px;
  font-weight: 500;
  align-self: flex-end;
  display: flex;

  color: #151515;
  background: #E2E9F9;
  min-height: 36px;
  height: auto;
  align-items: center;
  line-height: 1.3em;
  margin: 10px 0;
  :global(.dark) & {
    color: #fff;
    background: #2E3033;

    border: 1px solid #3F4245;
  }
}

.msgItemAi{
  @apply text-accent-foreground dark:text-muted-foreground py-4 gap-4 w-full;
  line-height: 1.7em;
}

.codeIcon{
  @apply rounded-[0.5rem] w-10 h-10 bg-black/5 dark:bg-white/5 self-stretch flex items-center justify-center;
  background: #E9EEF6;
  border-radius: 6px;
  color: #000000;
  line-height: 1;
  :global(.dark) & {
    background: #C1C4C9;
  }
}

.markdownBody{
  font-size: 14px;
  background-color: transparent !important;
  :global{
    pre{
      background-color:transparent !important;
    }
    p{
      margin-top: 10px !important;
      margin-bottom: 10px !important;
    }
  }
}

.options{
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  // margin-bottom: 12px;

  height: 46px;
  background: #F2F2F2;
  border-radius: 8px 8px 0px 0px;

  :global(.dark) & {
    background: #27272A;
  }

  .codeType{
    font-weight: 500;
    font-size: 16px;
    color: #151515;
    font-style: normal;
    display: flex;
    align-items: center;
    cursor: pointer;
    :global(.dark) & {
      color: #fff;
    }
  }
  .chevron {
    opacity: 0.6;
    transition: transform 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left:4px;
  }
  .chevronOpen {
    transform: rotate(180deg);
  }
}

.codeView{
  margin-top: 20px;
  border: 1px solid #E3E3E3;
  border-radius: 8px;
  :global(.dark) & {
    border: 1px solid #3F3F46;
  }
  .codeCont{
    // max-height: 550px;
    overflow-y: auto;
  }
}

.button1 {
  flex: 1;
  padding: 0px 16px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  background-color: transparent;
  color: #151515;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.3s;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;

  i{
    margin-top: 1px;
    font-size: 16px;
    margin-right: 8px;
  }
  &:hover {
    background-color: #E5E6E8;
  }

  :global(.dark) & {
    color: #d1d5db;
    // border-color: #3F4245;
    background-color: transparent;

    &:hover {
      background-color:#313234;
    }
  }
}

.chatContainer{
  display: flex;
  flex-direction: column;
}

.codeItem{
  @apply py-2 pl-2 w-full md:w-max flex items-center border rounded-xl select-none hover:bg-white dark:hover:bg-white/5 hover:cursor-pointer;
  margin-top: 16px;

  background: #FFFFFF;
  border-radius: 8px;
  border: 1px solid #C6C3CD;
  padding: 11px;

  :global(.dark) & {
    color: #fff;
    background: #2E3033;
    border: 1px solid #3F4245;
  }
}

.openButton{
  height: 32px;
  background: linear-gradient( 138deg, #6846F4 0%, #004DFF 39%, #00C4DE 76%, #52CE73 100%);
  border-radius: 6px;
  width: 60px;
  display: flex;
  justify-content: center;
  align-items: center;
  color: #fff;
  font-size: 14px;
}


.msgOptions{
  display: flex;
  align-items: center;
  margin-top: 8px;
  border-bottom: 1px solid #D9D9D9;
  padding-bottom: 20px;
  margin-bottom:20px;
  line-height: 1;

  i {
    cursor: pointer;
    font-size: 16px;
    color: #71717A;
    padding: 12px 12px;
    border-radius: 4px;
    transition: all 0.2s ease;
    border-radius: 100%;

    &:hover {
      background-color:#E1E1E1;
    }
  }

  :global(.dark) & {
    border-bottom: 1px solid #3F3F46;
    i {
      color: #A1A1AA;
      &:hover {
        color: #fff;
        background-color: rgba(255, 255, 255, 0.1);
      }
    }
  }
}

.compContBody{
  margin: 0 auto;
  width: 100%;
}

.max800 {
  max-width: 800px;
}